/*eslint-disable*/
import React, { useState, useEffect } from 'react'
import './index.css'
import request from '../../utils/request'
import { useLocation, useHistory } from 'react-router-dom'
import { getHousesDetail, addFavorites, getIsFavorites } from '../../api/index'
import { Swiper, Toast, Tag, Button } from 'antd-mobile'

const detailpage = (props) => {

    const { state } = useLocation()

    const history = useHistory()
    //详情页数据

    const [obj, setobj] = useState({})

    //判断是否收藏
    const [isFavorite, setisFavorite] = useState(false)

    console.log(history);

    useEffect(() => {
        detaillist()
    }, [])

    const detaillist = async () => {
        let res = await getHousesDetail({ id: state.id })
        setobj(res.body)
        let resp = await getIsFavorites({ id: res.body })
        setisFavorite(resp.body)
        console.log(resp.body)
    }

    return (
        <div>123</div>
    )
}
export default detailpage
